

#include "helloworldButton.h"
#include "renderer.h"
#include "input.h"

HelloworldButton::HelloworldButton()
{
    listType.push_back( "17CreateActorButton" );
    listType.push_back( "20PropertyAssignButton" );

    listProp.push_back("15HelloworldActor");
    listProp.push_back("TEXTUREID");

    listName.push_back("None");
    listName.push_back("string icon_palette");
}
HelloworldButton::~HelloworldButton(){}


void HelloworldButton::setup(){
Button::setup();

}

void HelloworldButton::update(double deltaTime)
{

}

void HelloworldButton::mouseOver(){

Button::mouseOver();
}

void HelloworldButton::mouseDrag()
{
    input->dragButton = this;
    cout << "mouse dragging from hello world!" << endl;
    setLocation( Vector3f( input->mouseX - (scale.x*.5f), input->mouseY - (scale.y*.5f), 0 ) );

}
void HelloworldButton::finishDrag()
{
    input->dragButton = NULL;
    if( input->worldTarget ) cout << "target: " << input->worldTarget->name << endl;
}
void HelloworldButton::clickedLeft()
{
    ListButton::clickedLeft();
}
void HelloworldButton::clickedRight(){}
void HelloworldButton::focusClick(){
    cout << "hello world!!!" << endl;
    if( input->worldTarget ) cout << input->worldTarget->name << endl;
    if( input->worldTarget ) input->worldTarget->addRotation( Vector3f(30,0,0) );

Button::focusClick();
}

void HelloworldButton::deselect(int depth){

ListButton::deselect(depth);
}

void HelloworldButton::create(){renderer->addButton(this);}

void HelloworldButton::trigger(Actor * other)
{

 cout << "trigger hw!" << endl;
 if( input->worldTarget ) cout << input->worldTarget->name << endl;
}
